#!/bin/bash
if [ $# != 1 ] ; then 
    echo "USAGE: $0 comment" 
    exit 1;
fi 
SRCS=$(find . -name "*.[h|c]" -o -name "*.cpp" -o -name "*.hpp" -o -name "*.hxx" -o -name "*.cc") 



CurrentDir=$(basename $(pwd))
DATE=$(date +%Y-%m-%d___%H-%M-%S)

SRC_TARGETFILENAME=${CurrentDir}_${DATE}_srcbak.tar.gz
READMEFILE=ReadMe_${DATE}.txt

echo $1 > ${READMEFILE}

echo "源码备份打包目标文件:$SRC_TARGETFILENAME"

tar -zcvf  $SRC_TARGETFILENAME  $SRCS ${READMEFILE}




